package cn.gov.pbc.gd.credit.web.controller.sysconf;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.liu.jbase.ResultVo;
import com.liu.jbase.controller.impl.BaseControllerImpl;
import com.liu.tools.StrUtil;
import com.liu.tools.WebHelper;

import cn.gov.pbc.gd.credit.user.service.dictionary.IDictionaryService;
import cn.gov.pbc.gd.credit.vo.dictionary.DictionaryVo;
import cn.gov.pbc.gd.credit.vo.dictionary.ResDictionaryVo;

@Controller
@RequestMapping("/sysconf")	
public class SysConfController extends BaseControllerImpl<ResDictionaryVo, DictionaryVo, IDictionaryService> {

	
	@Autowired
    private IDictionaryService dictionaryService;
	
    @ResponseBody
    @RequestMapping("/batch/update")
    public ResultVo<?> batch(DictionaryVo vo, HttpServletRequest request) {
		String body = WebHelper.getHttpBody(request);
		if(StrUtil.isNotNull(body)){
			vo = JSON.parseObject(body, DictionaryVo.class);
		}

		return dictionaryService.update(vo, request);
    }
}
